#include <iostream>
using namespace std;

string sdgem(string &a)
{
    string s = "";
    for (int i = 1; i < a.length(); i++)
    {
        int n1 = a[i] - '0';
        int n2 = a[i - 1] - '0';
        int n3 = max(n1, n2);
        if ((n1 % 2) == (n2 % 2))
        {
            string b = to_string(n3);
            s += b;
        }
    }
    return s;
}

int main()
{
    string s1, s2;
    cin >> s1 >> s2;
    s1 = sdgem(s1);
    s2 = sdgem(s2);
    if (s1 == s2)
    {
        cout << s1;
    }
    else
    {
        cout << s1 << endl
             << s2;
    }
    return 0;
}